"""绘制直方图"""
import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(7, 5))
plt.rcParams['font.family'] = ['SimHei']  # 用来显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号
x = np.arange(1, 6)
Y1 = np.random.uniform(1.5, 1.0, 5)
Y2 = np.random.uniform(1.5, 1.0, 5)
plt.bar(x, Y1, width=0.35, facecolor='lightskyblue', edgecolor='white')
plt.bar(x + 0.35, Y2, width=0.35, facecolor='yellowgreen', edgecolor='white')
plt.show()
fig.savefig("pic/ex11.png", format='png', transparent=True, dpi=300, pad_inches=0)
